<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, the Front-Cover texts being (a) (see below), and
with the Back-Cover Texts being (b) (see below).  A copy of the
license is included in the section entitled "GNU
Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Installing GCC: Final installation</title>

<meta name="description" content="Installing GCC: Final installation">
<meta name="keywords" content="Installing GCC: Final installation">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<style type="text/css">
<!--
div.example {margin-left: 3.2em}
ul.mark-bullet {list-style-type: disc}
-->
</style>


</head>

<body lang="en">


























<p>Now that GCC has been built (and optionally tested), you can install it with
</p><div class="example smallexample">
<pre class="example-preformatted">cd <var class="var">objdir</var> &amp;&amp; make install
</pre></div>

<p>We strongly recommend to install into a target directory where there is
no previous version of GCC present.  Also, the GNAT runtime should not
be stripped, as this would break certain features of the debugger that
depend on this debugging information (catching Ada exceptions for
instance).
</p>
<p>That step completes the installation of GCC; user level binaries can
be found in <samp class="file"><var class="var">prefix</var>/bin</samp> where <var class="var">prefix</var> is the value
you specified with the <samp class="option">--prefix</samp> to configure (or
<samp class="file">/usr/local</samp> by default).  (If you specified <samp class="option">--bindir</samp>,
that directory will be used instead; otherwise, if you specified
<samp class="option">--exec-prefix</samp>, <samp class="file"><var class="var">exec-prefix</var>/bin</samp> will be used.)
Headers for the C++ library are installed in
<samp class="file"><var class="var">prefix</var>/include</samp>; libraries in <samp class="file"><var class="var">libdir</var></samp>
(normally <samp class="file"><var class="var">prefix</var>/lib</samp>); internal parts of the compiler in
<samp class="file"><var class="var">libdir</var>/gcc</samp> and <samp class="file"><var class="var">libexecdir</var>/gcc</samp>; documentation
in info format in <samp class="file"><var class="var">infodir</var></samp> (normally
<samp class="file"><var class="var">prefix</var>/info</samp>).
</p>
<p>When installing cross-compilers, GCC&rsquo;s executables
are not only installed into <samp class="file"><var class="var">bindir</var></samp>, that
is, <samp class="file"><var class="var">exec-prefix</var>/bin</samp>, but additionally into
<samp class="file"><var class="var">exec-prefix</var>/<var class="var">target-alias</var>/bin</samp>, if that directory
exists.  Typically, such <em class="dfn">tooldirs</em> hold target-specific
binutils, including assembler and linker.
</p>
<p>Installation into a temporary staging area or into a <code class="command">chroot</code>
jail can be achieved with the command
</p>
<div class="example smallexample">
<pre class="example-preformatted">make DESTDIR=<var class="var">path-to-rootdir</var> install
</pre></div>

<p>where <var class="var">path-to-rootdir</var> is the absolute path of
a directory relative to which all installation paths will be
interpreted.  Note that the directory specified by <code class="code">DESTDIR</code>
need not exist yet; it will be created if necessary.
</p>
<p>There is a subtle point with tooldirs and <code class="code">DESTDIR</code>:
If you relocate a cross-compiler installation with
e.g. &lsquo;<samp class="samp">DESTDIR=<var class="var">rootdir</var></samp>&rsquo;, then the directory
<samp class="file"><var class="var">rootdir</var>/<var class="var">exec-prefix</var>/<var class="var">target-alias</var>/bin</samp> will
be filled with duplicated GCC executables only if it already exists,
it will not be created otherwise.  This is regarded as a feature,
not as a bug, because it gives slightly more control to the packagers
using the <code class="code">DESTDIR</code> feature.
</p>
<p>You can install stripped programs and libraries with
</p>
<div class="example smallexample">
<pre class="example-preformatted">make install-strip
</pre></div>

<p>By default, only the man pages and info-format GCC documentation
are built and installed.  If you want to generate the GCC manuals in
other formats, use commands like
</p>
<div class="example smallexample">
<pre class="example-preformatted">make dvi
make pdf
make html
</pre></div>

<p>to build the manuals in the corresponding formats, and
</p>
<div class="example smallexample">
<pre class="example-preformatted">make install-dvi
make install-pdf
make install-html
</pre></div>

<p>to install them.
Alternatively, there are prebuilt online versions of the manuals for
released versions of GCC on
<a class="uref" href="https://gcc.gnu.org/onlinedocs/">the GCC web site</a>.
</p>
<p>If you are bootstrapping a released version of GCC then please
quickly review the build status page for your release, available from
<a class="uref" href="https://gcc.gnu.org/buildstat.html">https://gcc.gnu.org/buildstat.html</a>.
If your system is not listed for the version of GCC that you built,
send a note to
<a class="email" href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a> indicating
that you successfully built and installed GCC.
Include the following information:
</p>
<ul class="itemize mark-bullet">
<li>Output from running <samp class="file"><var class="var">srcdir</var>/config.guess</samp>.  Do not send
that file itself, just the one-line output from running it.

</li><li>The output of &lsquo;<samp class="samp">gcc -v</samp>&rsquo; for your newly installed <code class="command">gcc</code>.
This tells us which version of GCC you built and the options you passed to
configure.

</li><li>If the build was for GNU/Linux, also include:
<ul class="itemize mark-bullet">
<li>The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
this information should be available from <samp class="file">/etc/issue</samp>.

</li><li>The version of the Linux kernel, available from &lsquo;<samp class="samp">uname --version</samp>&rsquo;
or &lsquo;<samp class="samp">uname -a</samp>&rsquo;.

</li><li>The version of glibc you used; for RPM-based systems like Red Hat,
Mandrake, and SuSE type &lsquo;<samp class="samp">rpm -q glibc</samp>&rsquo; to get the glibc version,
and on systems like Debian and Progeny use &lsquo;<samp class="samp">dpkg -l libc6</samp>&rsquo;.
</li></ul>
<p>For other systems, you can include similar information if you think it is
relevant.
</p>
</li><li>Any other information that you think would be useful to people building
GCC on the same configuration.  The new entry in the build status list
will include a link to the archived copy of your message.
</li></ul>

<p>We&rsquo;d also like to know if the
<a class="uref" href="specific.html">host/target specific installation notes</a>
didn&rsquo;t include your host/target information or if that information is
incomplete or out of date.  Send a note to
<a class="email" href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a> detailing how the information should be changed.
</p>
<p>If you find a bug, please report it following the
<a class="uref" href="../bugs/">bug reporting guidelines</a>.
</p>
<hr />
<p>
<p><a class="uref" href="./index.html">Return to the GCC Installation page</a>
</p>







</body>
</html>
